-- GENERATED SPELL FOR [Dun Garok Rifleman] --


function spell0_2345(pUnit, Event) --@Piercing Shot,n/a--
pUnit:FullCastSpellOnTarget(6685,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2345', 15000, 1)
end

function spell1_2345(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(6660,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2345', 618, 1)
end

function Sorts_2345(pUnit, Event)
local choix_sorts_2345 = math.random(0, 1)
if choix_sorts_2345 == 0 then
pUnit:RegisterEvent('spell0_2345', 1, 1)
end
if choix_sorts_2345 == 1 then
pUnit:RegisterEvent('spell1_2345', 1, 1)
end
end

function mob2345_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2345', math.random(1500, 3000), 1)
end

function mob2345_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2345_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2345_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2345, 1, 'mob2345_Action')
RegisterUnitEvent(2345, 2, 'mob2345_Leave')
RegisterUnitEvent(2345, 3, 'mob2345_Kill')
RegisterUnitEvent(2345, 4, 'mob2345_Die')
